function delay (fn, ms, ...args) {
  return new Promise((resolve, reject)=>{
      sleep(ms).then(()=>{
          try{
              resolve(fn(...args))
          }catch(e){
              reject(e)
          }
      })
  })
}